from django.contrib import admin

from .models import Grades,Students,teacher
@admin.register(Students)
class Students(admin.ModelAdmin):
    list_display = ['id','sname','sage','ssex','sheight','sweight','sdescription','isDelete','screateTime','supdateTime',]

    list_filter = ['id','sname']

#Create you models here.
# class Grades(models.Model):
#     pass

    # sname = models.CharField(max_length=20,verbose_name='学生姓名')
    # sage =models.IntegerField(verbose_name='年龄')
    # ssex = models.CharField(max_length=10,choices=[('boy','男'),('girl','女')],verbose_name='性别')
    # sheight = models.FloatField(verbose_name='身高')
    # sweight = models.FloatField(verbose_name='体重')
    # sdescription = models.CharField(max_length=50,verbose_name='介绍')
    # isDelete = models.BooleanField(default=False,verbose_name='是否删除')
    # screateTime = models.DateTimeField(auto_now_add=True,verbose_name='创建时间')
    # supdateTime = models.DateTimeField(auto_now=True,verbose_name='更新时间')
    #
    #
    # def __str__(self):
    #     return  self.sname
    #
    # @classmethod
    # def addSudents(cls, sname, sage, ssex, sheight, sweight,sdescription):
    #     newStudent = cls(sname=sname,sage=sage,ssex=ssex,sheight=sheight,sweight=sweight,sdescription=sdescription)
    #     return  newStudent


#班级
@admin.register(Grades)
class Grades(admin.ModelAdmin):
    list_display = ['id','gname','gteacher','ggirlnum','gboynum','isDelete','gcreateTime','gupdateTime',]

#教师表
@admin.register(teacher)
class teacher(admin.ModelAdmin):
    list_display = ['tname','isDelete','tcreateTime','tupdateTime','tcource','cschool']